package com.glink.manage.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum AiCodeDict {
    /** 200 */  NORMAL("200", "算法正常识别"),
    /** 400 */  MISTAKE("400","不含该类别编码或者图片编码有误"),
    ERROR("500", "算法分析接口调用失败"),
    REPEAT("601", "算法分析重复告警");

    private String key;
    private String val;

    public static AiCodeDict valueOfKey(String key) {
        for (AiCodeDict aiCodeDict : AiCodeDict.values()) {
            if (aiCodeDict.getKey().equals(key)) {
                return aiCodeDict;
            }
        }
        throw new IllegalArgumentException("未知的key: " + key);
    }
}
